package com.edu.fjnu.eshop.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.edu.fjnu.eshop.dao.AddressMapper;
import com.edu.fjnu.eshop.domain.Address;
import com.edu.fjnu.eshop.domain.User;

@Service("addressService")
public class AddressServiceImpl implements AddressService {

	@Autowired
	AddressMapper addressMapper;
	
	@Override
	public int getCount(User user) {
		return addressMapper.getCount(user);
	}

	@Override
	public List<Address> getAll(User user) {
		return addressMapper.getAll(user);
	}

	@Override
	public void save(Address address) {
		addressMapper.save(address);
	}

	@Override
	public void delete(int addId) {
		addressMapper.delete(addId);
	}

	@Override
	public void update(Address address) {
		addressMapper.update(address);
	}

	@Override
	public Address getAddrById(int addId) {
		return addressMapper.getAddrById(addId);
	}

}
